package STUDENT.TranNamAnh.OOPs.baitapmang.bt2;

public class Models {
	public int tinhTB(int[] i_Arr){
		int tong = 0;
		int sopt = 0;
		int trungbinh = 0;
		
		for(int i = 0;i< i_Arr.length;i++){
			if(i_Arr[i]>0){
			tong = tong + i_Arr[i];
			sopt++;
			}
		}
		trungbinh = tong/sopt;
		
		
		
		return trungbinh;
		
		
	}
	
	public double tinhTB(double[] d_Arr){
		double tong = 0;
		double sopt = 0;
		double trungbinh = 0;
		
		for(int i = 0;i< d_Arr.length;i++){
			if(d_Arr[i]>0){
		
			tong += tong + d_Arr[i];
			sopt++;
			}
		}
		trungbinh = tong/sopt;
		
		
		
		return trungbinh;
	}
}
